<template>
  <base-breadcrumb :breadcrumb="!isAudit">
    <a-card v-loading="loadingState.isDetail">
      <a-tabs
        ref="tabs"
        v-model="nextSteps"
        @change="callback"
      >
        <a-tab-pane
          key="1"
          tab="基本信息"
        >
          <a-row :gutter="24">
            <template v-if="isDetails == 1">
              <a-col
                :md="8"
                :sm="8"
              >
                <a-form-item
                  label="分包合同额(万)"
                  :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                  :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
                >
                  <BaseInput
                    v-model="dels.contractAmount"
                    type="text"
                    disabled
                  />
                </a-form-item>
              </a-col>
              <a-col
                :md="8"
                :sm="8"
              >
                <a-form-item
                  label="备注"
                  :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                  :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
                >
                  <BaseTextarea
                    v-model="dels.remark"
                    disabled
                  />
                </a-form-item>
              </a-col>
            </template>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="工程承包模式"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.contractModelName"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="承包类型"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.innerPackageName"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              v-if="isContract"
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="专业承包公司"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.contractBranchName"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <template v-if="isGeneral">
              <a-col
                :md="8"
                :sm="8"
              >
                <a-form-model-item
                  label="总承包项目是否内部项目"
                  :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                  :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
                  prop="epcIsInnerProject"
                >
                  <BaseInput
                    :value="dels.epcIsInnerProject?'是':'否'"
                    type="text"
                    disabled
                  />
                </a-form-model-item>
              </a-col>
              <a-col
                :md="8"
                :sm="8"
              >
                <a-form-item
                  label="总承包单位"
                  :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                  :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
                >
                  <BaseInput
                    v-model="dels.generalContractorCompanyName"
                    type="text"
                    disabled
                  />
                </a-form-item>
              </a-col>
              <a-col
                v-if="dels.epcIsInnerProject"
                :md="8"
                :sm="8"
              >
                <a-form-model-item
                  label="分包合同额（万）"
                  :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                  :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
                  prop="subContractAmount"
                >
                  <BaseInput
                    v-model="dels.subContractAmount"
                    type="text"
                    disabled
                  />
                </a-form-model-item>
              </a-col>
              <a-col
                v-if="dels.epcIsInnerProject"
                :md="24"
                :sm="24"
              >
                <a-form-model-item
                  label="备注"
                  :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                  :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
                  prop="remark"
                >
                  <BaseTextarea
                    v-model="dels.remark"
                    disabled
                  />
                </a-form-model-item>
              </a-col>
            </template>

            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="项目备案名称"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.projectName"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="项目简称"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.projectOmit"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="项目编号"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.projectNum"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="中标时间"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.winningTime"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="一级地域"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.oneAreaName"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="二级地域"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.secondAreaName"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="三级地域"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.threeAreaName"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="四级地域"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.fourAreaName"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="地理坐标"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInputNumber
                  v-model="dels.longitude"
                  type="text"
                  style="margin-right: 20px; width: 100px !important; float: left"
                  disabled
                />
                <BaseInputNumber
                  v-model="dels.latitude"
                  type="text"
                  style="width: 100px !important; float: left"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="24"
              :sm="24"
            >
              <a-form-item
                label="详细地址"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseTextarea
                  v-model="dels.projectAddress"
                  :title="dels.projectAddress"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="区域一级管辖单位(所属办事处)"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.jurisdictionOneName"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="区域二级管辖单位(所属办事处)"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.jurisdictionTwoName"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="签约单位"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
              <a-select
                :show-arrow="false"
                v-model="dels.signUnitId"
                :disabled="true"
                placeholder="请选择">
                <a-select-option :key="item.id" :value="item.id" v-for="item in contractUnitList">
                  {{ item.name }}
                </a-select-option>
              </a-select>
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="承接名义"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.undertakeName"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="实施单位(所属二级单位)"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.implementationTwoName"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="实施单位(所属三级单位)"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.implementationThreeName"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="项目类型"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.projectTypeName"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="项目业态"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.projectFormatName"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="结构类型"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.structureTypeName"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="24"
              :sm="24"
            >
              <a-form-model-item
                label="风险条件"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
                prop="riskCondition"
              >
                <TreeSelect :value="dels.riskCondition" disabled placeholder="" />
              </a-form-model-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="项目重要程度"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.projectImportanceName"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="是否为重点项目"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.keyProjectsName"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="工程类型"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.engineeringTypeName"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="工程性质"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.projectNatureName"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="局级大客户"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.bureauCustomerName"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="公司级大客户"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.companyCustomerName"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="客户级别"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.customerLevelName"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="设计单位名称"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.designUnitName"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="建设单位名称"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.constructionName"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="建设单位性质"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.constructionNatureName"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="建设单位社会统一信用代码"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.constructionCode"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="审计单位名称"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.auditName"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="监理单位名称"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.supervisionName"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="勘察单位名称"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.surveyName"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="咨询单位名称"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.consultingName"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="是否签订合同"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <a-radio-group
                  v-model="dels.contractCode"
                  disabled
                >
                  <a-radio :value="1">
                    已签订
                  </a-radio>
                  <a-radio :value="0">
                    未签订
                  </a-radio>
                </a-radio-group>
              </a-form-item>
            </a-col>
            <a-col
              v-if="isContractMileage"
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="合同工程里程(Km)"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.contractMileage"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <template
              v-if="isConstruction"
              :gutter="24"
            >
              <a-col
                :md="8"
                :sm="8"
              >
                <a-form-item
                  label="合同建筑面积-地上(万m2)"
                  :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                  :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
                >
                  <BaseInput
                    v-model="dels.contractAreaGround"
                    type="text"
                    disabled
                  />
                </a-form-item>
              </a-col>

              <a-col
                :md="8"
                :sm="8"
              >
                <a-form-item
                  label="合同建筑面积-地下(万m2)"
                  :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                  :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
                >
                  <BaseInput
                    v-model="dels.contractAreaUnderground"
                    type="text"
                    disabled
                  />
                </a-form-item>
              </a-col>

              <a-col
                :md="8"
                :sm="8"
              >
                <a-form-item
                  label="地上层数"
                  :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                  :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
                >
                  <BaseInput
                    v-model="dels.groundFloor"
                    type="text"
                    disabled
                  />
                </a-form-item>
              </a-col>
              <a-col
                :md="8"
                :sm="8"
              >
                <a-form-item
                  label="地下层数"
                  :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                  :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
                >
                  <BaseInput
                    v-model="dels.undergroundFloor"
                    type="text"
                    disabled
                  />
                </a-form-item>
              </a-col>
              <a-col
                :md="8"
                :sm="8"
              >
                <a-form-item
                  label="合同建筑总面积(万m2)"
                  :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                  :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
                >
                  <BaseInput
                    v-model="dels.contractTotalArea"
                    type="text"
                    disabled
                  />
                </a-form-item>
              </a-col>
            </template>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="合同单体工程个数"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.contractSingleProject"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                :label="engineeringMetersLabel"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.engineeringMeters"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <!--<a-col :md="8" :sm="8">-->
            <!--<a-form-item-->
            <!--label="维保期时间"-->
            <!--:labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"-->
            <!--:wrapperCol="{ lg: { span: 17 }, sm: { span: 17 } }"-->
            <!--&gt;-->
            <!--<BaseInput v-model="dels.maintenanceTime" type="text" disabled></BaseInput>-->
            <!--</a-form-item>-->
            <!--</a-col>-->
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="合同开工日期"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <a-date-picker
                  v-model="dels.contractStartDate"
                  disabled
                  placeholder="请选择日期"
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="合同竣工日期"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <a-date-picker
                  v-model="dels.contractEndDate"
                  disabled
                  style=""
                  placeholder="请选择日期"
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="合同工期(天)"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.contractDays"
                  disabled
                  placeholder="合同工期"
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="合同额(万)"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.contractValue"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="自有施工合同额(万)"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.ownerContractValue"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="专业工程暂估价总额(万)"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.estimateTotalAmount"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              v-if="isDetails == 0"
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="备案项目经理"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-if="dels.projectManager"
                  v-model="dels.projectManager.label"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              v-if="isDetails == 1"
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="专业项目经理"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.projectManagerName"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="24"
              :sm="24"
            >
              <a-form-item
                label="项目特点或难点"
                :label-col="{ lg: { span: 6 }, sm: { span: 6 } }"
                :wrapper-col="{ lg: { span: 16 }, sm: { span: 16 } }"
              >
                <BaseInput
                  v-model="dels.projectFeatures"
                  type="textarea"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="24"
              :sm="24"
            >
              <a-form-item
                label="主施工范围"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.mainScope"
                  type="textarea"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="计划创优级别"
                :label-col="{ lg: { span: 6 }, sm: { span: 6 } }"
                :wrapper-col="{ lg: { span: 16 }, sm: { span: 16 } }"
              >
                <BaseInput
                  v-model="dels.excellencePlanName"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="计划创优内容"
                :label-col="{ lg: { span: 6 }, sm: { span: 6 } }"
                :wrapper-col="{ lg: { span: 16 }, sm: { span: 16 } }"
              >
                <BaseInput
                  v-model="dels.meritContentName"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="计划观摩级别"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.observePlanName"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="24"
              :sm="24"
            >
              <a-form-item
                label="计划观摩内容"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.observeContent"
                  type="textarea"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="项目设计管理类别"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.designName"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="项目科技管理类别"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.technologyName"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item
                label="项目类别（质量）"
                :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
              >
                <BaseInput
                  v-model="dels.qualityName"
                  type="text"
                  disabled
                />
              </a-form-item>
            </a-col>

            <a-button
              style="float: right; margin-top: 20px;margin-right: 20px;"
              type="primary"
              @click="nextStep()"
            >
              下一页
            </a-button>
          </a-row>
        </a-tab-pane>

        <a-tab-pane
          key="2"
          tab="项目部设置"
        >
          <title-name title="项目领导班子人员配置" />
          <a-table
            :columns="columns"
            :data-source="projectPost"
            bordered
            :pagination="false"
          >
            <span
              slot="serial"
              slot-scope="text, record, index"
            >{{ index + 1 }}</span>
            <span
              slot="jobName"
              slot-scope="text, record"
            >
              <template>
                {{ record.jobName }}
              </template>
            </span>
            <span
              slot="employeeName"
              slot-scope="record"
            >
              <template>
                <!--{{record.staffList.map(s=>s.staffName).join(',')}}-->
                <span
                  v-for="(staff, index) in record.staffList"
                  :key="index"
                >
                  <span v-if="index != 0">,</span>
                  <span
                    v-if="staff.statusCode == 0"
                    style="color: rgba(0, 0, 0, 0.65)"
                  >{{ staff.staffName }}</span>
                  <span
                    v-else-if="staff.statusCode != 0"
                    style="color: red"
                  >{{ staff.staffName }}</span>
                </span>
              </template>
            </span>
            <span
              slot="employeeNum"
              slot-scope="record"
            >
              <template>
                <span
                  v-for="(staff, index) in record.staffList"
                  :key="index"
                >
                  <!--<span v-if="index !=0 ">,</span>-->
                  <!--<sapn v-if="staff.statusCode == 0 " style="color:rgba(0, 0, 0, 0.65)">{{staff.staffCode}}</sapn>-->
                  <!--<sapn v-else-if="staff.statusCode != 0 " style="color:red;">{{staff.staffCode}}</sapn>-->
                  <sapn
                    v-if="staff.statusCode == 0"
                    style="color: rgba(0, 0, 0, 0.65)"
                  >{{ staff.staffCode }}</sapn>
                  <sapn
                    v-else-if="staff.statusCode != 0"
                    style="color: red"
                  >{{ staff.staffCode }}</sapn>
                  <span v-if="record.staffList && index < record.staffList.length - 1 && staff.staffCode">,</span>
                </span>
              </template>
            </span>
            <span
              slot="status"
              slot-scope="record"
            >
              <template>
                {{ record.staffList.map((s) => s.statusName).join(',') }}
              </template>
            </span>
            <span
              slot="operation"
              slot-scope="text, record"
            >
              <template>
                <a @click="handleEdit(record)">编辑</a>
              </template>
            </span>
          </a-table>

          <title-name
            title="其他岗位人员配置"
            style="margin-top: 20px"
          />
          <a-table
            :columns="columns"
            :data-source="otherPost"
            bordered
            :pagination="false"
          >
            <span
              slot="serial"
              slot-scope="text, record, index"
            >{{ index + 1 }}</span>
            <span
              slot="jobName"
              slot-scope="text, record"
            >
              <template>
                {{ record.jobName }}
              </template>
            </span>
            <span
              slot="employeeName"
              slot-scope="record"
            >
              <template>
                <span
                  v-for="(staff, index) in record.staffList"
                  :key="index"
                >
                  <span v-if="index != 0">,</span>
                  <span
                    v-if="staff.statusCode == 0"
                    style="color: rgba(0, 0, 0, 0.65)"
                  >{{ staff.staffName }}</span>
                  <span
                    v-else-if="staff.statusCode != 0"
                    style="color: red"
                  >{{ staff.staffName }}</span>
                </span>
              </template>
            </span>
            <span
              slot="employeeNum"
              slot-scope="record"
            >
              <template>
                <span
                  v-for="(staff, index) in record.staffList"
                  :key="staff"
                >
                  <span v-if="index != 0">,</span>
                  <sapn
                    v-if="staff.statusCode == 0"
                    style="color: rgba(0, 0, 0, 0.65)"
                  >{{ staff.staffCode }}</sapn>
                  <sapn
                    v-else-if="staff.statusCode != 0"
                    style="color: red"
                  >{{ staff.staffCode }}</sapn>
                </span>
              </template>
            </span>
            <span
              slot="status"
              slot-scope="record"
            >
              <template>
                {{ record.staffList.map((s) => s.statusName).join(',') }}
              </template>
            </span>
            <span
              slot="operation"
              slot-scope="text, record"
            >
              <template>
                <a @click="handleEdit(record)">编辑</a>
              </template>
            </span>
          </a-table>
          <title-name
            title="历史调整记录"
            style="margin-top: 20px"
          />
          <list-table
            ref="table"
            :row-key="(record) => record.id"
            :columns="columnsRecord"
            :request="loadDataRecord"
          >
            <span
              slot="serial"
              slot-scope="text, record, index"
            >{{ index + 1 }}</span>
          </list-table>
          <a-button
            style="float: right; margin-top: 20px; margin-right: 20px;"
            type="primary"
            @click="nextStep()"
          >
            下一页
          </a-button>
        </a-tab-pane>

        <a-tab-pane
          key="3"
          tab="附件上传"
        >
          <title-name title="附件上传" />
          <u-table
            :list-url="listUrl"
            :upload-list="uploadList"
            :delete-url="deleteUrl"
            :business-id="businessId"
            :is-show="isShow"
            business-code="PM01"
          />
        </a-tab-pane>
      </a-tabs>
    </a-card>

    <div
      v-if="!isAudit"
      class="page-btn-right-top"
    >
      <a-button
        type="primary"
        @click="goBack"
      >
        关闭
      </a-button>
    </div>
  </base-breadcrumb>
</template>

<script>
// import FooterToolBar from '@/components/FooterToolbar'
// import AddAdJust from './addAdjust'
import {
  getDataDicts,
  addProjectsInfo,
  getCustomerDicts,
  getAreadicts,
  getProjectManager,
  getProjectNum,
  getImCompany,
  getProjectsDel,
  getProjectFrom,
  getDepartConfig,
  addDepartmentConfig,
  getRegions
} from '@/api/project/projects'
import { getProjectJobAdjustsHistory } from '@/api/project/adjust'
import { getProjectypesList, getProjectypesOne } from '@/api/project/projectypes'
import { getImportantsList, getImportantsOne } from '@/api/project/importants'
import { getCustomerList, getCustomersOne } from '@/api/project/customers'
import { getTreeTypes, getMajorBranch } from '@/api/index'
import { getOrgUsers } from '@/api/commons'
import { themeChoose } from '../../../../mixin/mixin'
import { getContractUnitList } from '@/api/project/contracting'
import TreeSelect from './components/TreeSelect' // 【风险条件】专用
const columns = [
  {
    title: '序号',
    width: 65,
    scopedSlots: { customRender: 'serial' }
  },
  {
    title: '岗位名称',
    dataIndex: 'jobName',
    width: '30%',
    scopedSlots: { customRender: 'jobName' }
  },
  {
    title: '岗位人员姓名',
    width: '25%',
    scopedSlots: { customRender: 'employeeName' }
  },
  {
    title: '员工编号',
    width: '25%',
    scopedSlots: { customRender: 'employeeNum' }
  }
  // {
  //   title: '操作',
  //   dataIndex: 'operation',
  //   scopedSlots: { customRender: 'operation' }
  // }
]

const columnAssment = [
  {
    title: '序号',
    width: 65,
    dataIndex: 'serial',

    scopedSlots: { customRender: 'serial' }
  },
  {
    title: '附件名称',
    dataIndex: 'fileName',
    width: '15%'
  },
  {
    title: '附件格式',
    dataIndex: 'suffixName',
    width: '15%'
  },
  {
    title: '附件地址',
    dataIndex: 'rootPath',
    width: '40%'
  }
  // {
  //   title: '操作',
  //   key: 'action',
  //   width: '20%',
  //   scopedSlots: { customRender: 'action' },
  // },
]

const columnsRecord = [
  {
    title: '序号',
    width: '65px',
    scopedSlots: { customRender: 'serial' }
  },
  {
    title: '岗位名称',
    dataIndex: 'jobName'
  },
  {
    title: '调整类型',
    dataIndex: 'adjustType'
  },
  {
    title: '调整详情',
    dataIndex: 'adjustContent'
  },
  {
    title: '调整人',
    dataIndex: 'adjusterName'
  },
  {
    title: '调整时间',
    dataIndex: 'adjustTime'
  }
]

export default {
  name: 'a' + new Date().getTime(),
  mixins: [themeChoose],
  components: {
    TreeSelect
    // FooterToolBar,
    // AddAdJust
  },
  props: {
    text: String,
    isAudit: {
      type: Boolean,
      default: false
    }
  },

  data() {
    return {
      loadingState: {
        isDetail: false
      },
      columns,
      columnAssment,
      columnsRecord,
      dels: {}, // 详情
      form: {
        keyProjectsCode: '', // 是否为重点项目
        oneArea: {},
        secondArea: {},
        threeArea: {},
        fourArea: {}
      },

      // 附件上传
      listUrl: '/cscec-project-business/file/business/project-fileQuery',
      deleteUrl: '/cscec-project-business/file/business/project-fileDelete',
      uploadList: '/cscec-project-business/file/business/fileUpload',
      businessId: '',
      isShow: false,

      ungroundAreas: 0,
      totalArea: 0, // 合同建筑总面积
      groundAreas: 0, // 地上面积

      dataAssement: [],

      visible: false, // 人员配置调整
      confirmLoading: false,
      mdl: null, // 数据
      projectModecode: '', // 工程承包模式code
      projectModeId: '', // 工程承包模式
      isContract: false, // 专业承包分公司
      isGeneral: false, // 总承包公司

      editable: false,

      nextSteps: '1',

      selectDatas: {}, // 立项返回下拉数据

      editingKey: '',
      selectedRowKeys: [],
      value: 1, // 是否签订合同

      isContractMileage: false, // 线性基础数据
      isConstruction: true, // 房建
      managementLists: [], // 一级管辖单位
      agenciesLists: [], // 二级管辖单位
      threeCompany: [], // 实施单位三级
      projectForm: [], // 项目业态
      projectId: '', // 保存项目立项返回id
      oneAreaCodeName: '', // 一级区域名称
      secondAreaCodeName: '', // 二级区域名称
      threeAreaCodeName: '', // 三级区域名称
      fourAreaCodeName: '', // 四级区域名称
      projectManagerCodeName: '', // 备案项目经理名称
      twoCompany: '西南公司', // 实施单位二级
      levelName: '', // 客户级别
      startDate: '', //  开始时间
      endDate: '', //    结束时间

      countDate: 0, // 合同总工期,
      employeeNum: '', // 项目部设置人员调整员工编号

      projectPost: [], // 项目人员岗位设置
      otherPost: [], //  其他人员岗位设置

      contractingBranchs: [], // 专业承包分公司

      ispackage: '', // 是否外包
      isDetails: '', // 判断详情从那里进入 0项目列表 1专业项目
      // 最高(长)单位工程米数(Km)名字
      engineeringMetersLabel: '最高(长)单位工程米数(Km)',
      loadDataRecord: (parameter) => {
        const requestParameters = Object.assign({query:{projectId: this.projectId}}, parameter)
        return getProjectJobAdjustsHistory(requestParameters).then((res) => {
          return res
        })
      },
      //签约单位数据
      contractUnitList: [],
    }
  },

  created() {
    // 审批跳转过来时，传的是businessId字段
    this.projectId = this.$route.query.projectId || this.$route.query.businessId
    this.businessId = this.projectId
    this.isDetails = this.$route.query.isDetails
    if (this.projectId) {
      this.getProjectDels(this.projectId)
      this.getDepartConfig()
      this.getDepartConfigs()
      this.getContractUnitList()
    }
  },
  watch: {
    $route(to, from) {
      // 如果projectId和isDetails发生变化，那么就重新拉取数据
      const projectId = this.$route.query.projectId || this.$route.query.businessId
      const isDetails = this.$route.query.isDetails
      if (projectId !== this.projectId || isDetails !== this.isDetails) {
        this.projectId = projectId
        this.businessId = projectId
        this.isDetails = isDetails
        if (this.projectId) {
          this.getProjectDels(this.projectId)
          this.getDepartConfig()
          this.getDepartConfigs()
          this.getContractUnitList()
        }
      }
    }
  },
  methods: {
    goBack() {
      if (this.isDetails == 0) {
        this.$multiTab.close(this.$route.fullpath)
      } else {
        this.$multiTab.close(this.$route.fullpath)
      }
    },
    /**
     * @description: 获取签约单位列表
     * @return {void}
     */
     getContractUnitList() {
      getContractUnitList({needCount: false}).then(res => {
        let arr = [];
        res.data.map((item)=> {
          if(item.status!=='FALSE') arr.push(item)
        })
        this.contractUnitList = arr;
      })
    },
    // 根据id获取项目详情信息
    getProjectDels(getProjectId) {
      this.loadingState.isDetail = true
      getProjectsDel({ projectId: getProjectId })
        .then((res) => {
          this.loadingState.isDetail = false
          this.dels = res.data
          this.dels.riskCondition = res.data.riskCondition ? res.data.riskCondition.split(",") : []
          
          // contractBranch  isContract   generalContractorCompanyName isGeneral
          if(this.dels.projectFormatName instanceof Array){
            this.dels.projectFormatName = this.dels.projectFormatName.join(',')
          }
          if (this.dels.contractModelCode == 'zycb' && this.dels.innerPackageCode == 0) {
            this.isGeneral = true // 总承包
            this.isContract = false // 专业承包
          }
          if (this.dels.contractModelCode == 'zycb' && this.dels.innerPackageCode == 1) {
            this.isGeneral = false // 总承包
            this.isContract = true // 专业承包
          }
          if (this.dels.contractModelCode != 'zycb' && this.dels.innerPackageCode == 1) {
            this.isGeneral = false // 总承包
            this.isContract = true // 专业承包
          }
          if (this.dels.contractModelCode != 'zycb' && this.dels.innerPackageCode == 0) {
            this.isGeneral = false // 总承包
            this.isContract = false // 专业承包
          }

          // calculateTypeCode   // 项目类型计算方式

          if (this.dels.calculateTypeCode == '0') {
            this.isContractMileage = false
            this.isConstruction = true
          } else {
            this.isContractMileage = true
            this.isConstruction = false
          }

          this.dels.projectManager = {
            key: this.dels.projectManagerCode,
            label: this.dels.projectManagerName
          }

          this.dels.implementationThree = {
            key: this.dels.implementationThreeCode,
            label: this.dels.implementationThreeName
          }
          this.dels.innerPackageName = res.data.innerPackageCode === 0 ? '自主承包' : '内部承包'
          this.levelName = res.data.customerLevelName

          getTreeTypes({ query: { type: 1, parentId: null }, pageSize: 100 }).then((res) => {
            this.areaDicts = res.data
            const area = {
              key: this.dels.oneAreaCode,
              label: this.dels.oneAreaName
            }
            this.dels.oneArea = area
          })

          getTreeTypes({ query: { type: 1, parentId: this.dels.oneAreaCode }, pageSize: 100 }).then((res) => {
            this.areaDicts2 = res.data
            const area = {
              key: this.dels.secondAreaCode,
              label: this.dels.secondAreaName
            }
            this.form.secondArea = area
          })
          getTreeTypes({ query: { type: 1, parentId: this.dels.secondAreaCode }, pageSize: 100 }).then((res) => {
            this.areaDicts3 = res.data
            const area = {
              key: this.dels.threeAreaCode,
              label: this.dels.threeAreaName
            }
            this.form.threeArea = area
          })
          getTreeTypes({ query: { type: 1, parentId: this.dels.threeAreaCode }, pageSize: 100 }).then((res) => {
            this.areaDicts4 = res.data
            const area = {
              key: this.dels.fourAreaCode,
              label: this.dels.fourAreaName
            }
            this.dels.fourArea = area
          })

          this.selectChange(this.dels.contractModelCode)
          this.isInnerPackage(this.dels.innerPackageCode)
          // 项目类型为其他改变最高(长)单位工程米数字段名字
          if (this.dels.projectTypeCode === '638571526815358976') {
            // 其他
            this.engineeringMetersLabel = '最高(长)单位工程米数(km)'
          } else if (this.dels.projectTypeCode === '638571485077839872') {
            // 线性基础设施
            this.engineeringMetersLabel = '最长单位工程里程(km)'
          } else if (this.dels.projectTypeCode === '638571399132356608') {
            // 房建
            this.engineeringMetersLabel = '最高单位工程米数(米)'
          } else {
            this.engineeringMetersLabel = '最高(长)单位工程米数(km)'
          }
        })
        .catch(() => {
          this.loadingState.isDetail = false
        })
    },

    selectChange(value) {
      this.projectModeCode = value
      if (value != 'zycb' && this.ispackage == 0) {
        this.isGeneral = false // 总承包
        this.isContract = false // 专业承包
      }
      if (value == 'zycb' && this.ispackage == 0) {
        this.isGeneral = true // 总承包
        this.isContract = false // 专业承包
      }
    },

    isInnerPackage(value) {
      // 是否外包

      this.ispackage = value
      if (this.projectModeCode == 'zycb' && value == 0) {
        this.isGeneral = true // 总承包
        this.isContract = false // 专业承包
      }
      if (this.projectModeCode == 'zycb' && value == 1) {
        this.isGeneral = false // 总承包
        this.isContract = true // 专业承包
      }
      if (this.projectModeCode != 'zycb' && value == 1) {
        this.isGeneral = false // 总承包
        this.isContract = true // 专业承包
      }
      if (this.projectModeCode != 'zycb' && value == 0) {
        this.isGeneral = false // 总承包
        this.isContract = false // 专业承包
      }
    },

    getDepartConfig() {
      // 项目岗位设置
      getDepartConfig({ projectId: this.projectId, projectJobType: 1 }).then((res) => {
        this.projectPost = res.data.postConfigList
      })
    },
    getDepartConfigs() {
      // 其他岗位设置
      getDepartConfig({ projectId: this.projectId, projectJobType: 0 }).then((res) => {
        this.otherPost = res.data.postConfigList
      })
    },

    callback(key) {
      // tabs切换
      this.nextSteps = key
    },

    nextStep() {
      if (this.nextSteps == 1) {
        this.nextSteps = '2'
      } else if (this.nextSteps == 2) {
        this.nextSteps = '3'
      } else {
        return
      }
    }
  }
}
</script>

<style lang="less" scoped>
.requireRed {
  color: red;
}

/deep/ .ant-form-item label {
  font-size: 12px;
}

.ant-select {
  width: 100%;
}
</style>

